{% extends "admin/change_list.html" %}
{% load i18n %}

{% block extrahead %}
{{ block.super }}
<script type="text/javascript" src="{{ STATIC_URL }}edn/js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
  $('#custom-tools').hide();

  function toggle_main_actions() {
    $('#main-tools').slideToggle('medium');
  };

  $('#deploy-actions').click(function() {
    $('#custom-tools').slideToggle('medium', function () {
      toggle_main_actions();
    });
  });

  $('#unploy-actions').click(function() {
    $('#custom-tools').slideToggle('medium', function () {
      toggle_main_actions();
    });
  });

});
</script>
{% endblock %}

{% block object-tools %}
<ul class="object-tools" id="main-tools" style="position: bottom;">
  {% if has_add_permission %}
  <li>
    <a href="add/{% if is_popup %}?_popup=1{% endif %}" class="addlink">
      {% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}
    </a>
  </li>
  {% endif %}
  <li>
    <a href="#" class="addlink" id="deploy-actions">
      {% trans 'Actions' %}
    </a>
  </li>
</ul>

<ul class="object-tools" id="custom-tools">
  {% if has_add_permission %}
  <li>
    <a href="import/{% if is_popup %}?_popup=1{% endif %}" class="addlink">
      {% blocktrans with cl.opts.verbose_name as name %}Import {{ name }}s{% endblocktrans %}
    </a>
  </li>
  {% endif %}
  {% if perms.newsletter.add_mailinglist %}
  <li>
    <a href="create_mailinglist/{{ cl.get_query_string }}" class="viewsitelink">
      {% trans 'Add to a mailing list' %}
    </a>
  </li>
  {% endif %}
  {% if user.is_superuser %}
  <li>
    <a href="export_vcard/{{ cl.get_query_string }}" class="viewsitelink">
      {% blocktrans with cl.opts.verbose_name as name %}Export {{ name }} as VCard{% endblocktrans %}
    </a>
  </li>
  <li>
    <a href="export_excel/{{ cl.get_query_string }}" class="viewsitelink">
      {% blocktrans with cl.opts.verbose_name as name %}Export {{ name }} as Excel{% endblocktrans %}
    </a>
  </li>
  {% endif %}
  <li>
    <a href="#" id="unploy-actions">
      X
    </a>
  </li>
</ul>
{% endblock %}
